﻿using System;

using System.Collections.Generic;
using System.Text;

namespace Silvermoon.Utils
{
    public static class MathUtil
    {
        /// <summary>
        /// Returns the fractional dicits of a floating point number.
        /// </summary>
        /// <param name="value">floating point number.</param>
        /// <returns>floating point number with fractional digits</returns>
        /// <example>
        /// FractionalDigits(3.14159f) return 0.14159f,
        /// FractionalDigits(455.9943f) return  0.9943f.
        /// </example>
        public static float FractionalDigits(float value)
        {
            
            float r = (float)(int)value;
            return value - r;
        }
    }
}
